package com.yawn.postgres.dao;

import com.yawn.postgres.entity.Person;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface PersonDao extends JpaRepository<Person, Long> {

    List<Person> getByAgeAfter(int age);

    @Query("from Person where id=?1")
    Person get(long id);

    @Query("from Person where name like ?1")
    List<Person> getByName(String name);


}
